<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- Bootstrap -->
    <div th:include="pages/include :: public_css"></div>
</head>
<body>
<div class="container-fluid">
    <div th:include="pages/include :: header"></div>
    <div class="row">
        <div class="col-md-2">
            <div th:include="pages/include :: menus"></div>
        </div>
        <div class="col-md-10">
            <div id="content">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        添加学生
                    </div>
                    <div class="panel-body">
                        <form th:action="@{/student/save}" method="post" th:object="${editBean}" class="form-horizontal">
                            <input type="hidden" name="id" th:value="*{id}">
                            <div class="form-group">
                                <label for="input_account" class="col-sm-2 control-label">学号</label>
                                <div class="col-sm-6">
                                    <input type="text" id="input_account" name="code" th:value="*{code}" class="form-control" placeholder="请输入学号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="input_password" class="col-sm-2 control-label">密码</label>
                                <div class="col-sm-6">
                                    <input type="password" id="input_password" name="password" th:value="*{password}" class="form-control" placeholder="请输入密码">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="input_name" class="col-sm-2 control-label">真实姓名</label>
                                <div class="col-sm-6">
                                    <input type="text" id="input_name" name="name" th:value="*{name}" class="form-control" placeholder="请输入真实姓名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="input_phone" class="col-sm-2 control-label">手机号码</label>
                                <div class="col-sm-6">
                                    <input type="text" id="input_phone" name="phone" th:value="*{phone}" class="form-control" placeholder="请输入手机号码">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="input_account" class="col-sm-2 control-label">选择宿舍楼</label>
                                <div class="col-sm-6">
                                    <select name="dormId" class="form-control">
                                        <option value="null">请选择</option>
                                        <option th:selected="*{dormId} == ${item.id}" th:value="${item.id}" th:text="${item.name}" th:each="item : ${dormList}"></option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">选择性别</label>
                                <div class="col-sm-6">
                                    <div class="radio">
                                        <label>
                                            <input type="radio" name="gender" th:checked="*{gender==0}" value="0"> 女
                                        </label>
                                        <label>
                                            <input type="radio" name="gender" th:checked="*{gender==1}" value="1"> 男
                                        </label>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-6">
                                    <button type="submit" class="btn btn-default">保存</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="pages/include :: public_js"></div>
<script type="text/javascript">
    $(document).ready(function () {
      console.log("addOrEdit 加载完成");
      menuActive();
      // $("#btn_add").click(function () {
      //
      // });
    });
</script>
</body>
</html>
